//
//  OSPlayVideoViewController.m
//  百思不得姐
//
//  Created by PushMeBaby on 16/3/12.
//  Copyright © 2016年 CoderC. All rights reserved.
//

#import "OSPlayVideoViewController.h"
#import "ZFPlayerView.h"
@interface OSPlayVideoViewController ()


@property (nonatomic,strong)ZFPlayerView *playerView;
@end

@implementation OSPlayVideoViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.playerView = [ZFPlayerView setupZFPlayer];
    self.playerView.size = CGSizeMake(OSScreenW, OSScreenW * self.topic.height / self.topic.width);
    self.playerView.center = self.view.center;
    self.playerView.isMaskShowing = NO;
    self.playerView.videoURL = [NSURL URLWithString:self.topic.videouri];
    [self.view addSubview:self.playerView];
    
    UIButton *backButton = [[UIButton alloc]init];
    CGFloat buttonX = 20;
    CGFloat buttonY = 25;
    CGFloat buttonW = 30;
    CGFloat buttonH = buttonW;
    backButton.frame = CGRectMake(buttonX, buttonY, buttonW, buttonH);
    [backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [backButton setImage:[UIImage imageNamed:@"show_image_back_icon"] forState:UIControlStateNormal];
    [self.view addSubview:backButton];
}
-(void)back{
    [self.playerView backButtonAction];
    [self dismissViewControllerAnimated:NO completion:nil];
}

@end
